
/** config indexes **/
db.getCollection("config").ensureIndex({
  "_id": NumberInt(1)
},[
  
]);

/** links indexes **/
db.getCollection("links").ensureIndex({
  "_id": NumberInt(1)
},[
  
]);

/** user indexes **/
db.getCollection("user").ensureIndex({
  "_id": NumberInt(1)
},[
  
]);

/** user indexes **/
db.getCollection("user").ensureIndex({
  "username": 1
},{
  "unique": true
});

/** config records **/
db.getCollection("config").insert({
  "_id": ObjectId("535777ba1dad8e838e6168a7"),
  "call_loop_limit_times": "10",
  "callback_sec": "60",
  "created_time": ISODate("2014-04-23T08:20:10.925Z"),
  "email": [
    {
      "name": "ThaiND",
      "email": "thaind@sunnet.vn"
    },
    {
      "name": "TrinhNT",
      "email": "trinhnt@sunnet.vn"
    }
  ],
  "sender": {
    "name": "Admin call link service [TrinhNT]",
    "email": "trinhnt@sunnet.vn",
    "pass": "trinh1987"
  },
  "timeout_seconds": "60"
});

/** links records **/
db.getCollection("links").insert({
  "_id": ObjectId("535742754ac3d35506e818cd"),
  "created_time": ISODate("2014-04-21T10:19:40.341Z"),
  "description": "Xử lý tin tức",
  "name": "Xử lý tin tức hay.qplay.vn",
  "status": true,
  "url": "http:\/\/hay.qplay.vn\/api\/update-news"
});
db.getCollection("links").insert({
  "_id": ObjectId("536b0b89dda59a240400000e"),
  "created_time": ISODate("2014-05-08T04:43:53.0Z"),
  "description": "Lấy báo dân trí",
  "name": "Lấy báo dân trí",
  "status": true,
  "url": "http:\/\/home.hayqplay.vn\/get-news-api?category=the-thao-trong-nuoc"
});

/** system.indexes records **/
db.getCollection("system.indexes").insert({
  "v": NumberInt(1),
  "key": {
    "_id": NumberInt(1)
  },
  "ns": "call_link.config",
  "name": "_id_"
});
db.getCollection("system.indexes").insert({
  "v": NumberInt(1),
  "key": {
    "_id": NumberInt(1)
  },
  "ns": "call_link.links",
  "name": "_id_"
});
db.getCollection("system.indexes").insert({
  "v": NumberInt(1),
  "key": {
    "_id": NumberInt(1)
  },
  "ns": "call_link.user",
  "name": "_id_"
});
db.getCollection("system.indexes").insert({
  "v": NumberInt(1),
  "key": {
    "username": 1
  },
  "unique": true,
  "ns": "call_link.user",
  "name": "username_1"
});

/** user records **/
db.getCollection("user").insert({
  "_id": ObjectId("534f4eda62b90a8db158bc21"),
  "email": "sauthienthuptit@gmail.com",
  "gold": 0,
  "name": "SauThienThu",
  "password": "68283009f2669351e0004bc22be7fbb7",
  "permission_manager": 1,
  "salt": "lihus",
  "username": "sauthienthu"
});
